import java.util.Scanner;

public class Test1 {
        public static void main(String[] args) {
            Scanner input = new Scanner(System.in);
            System.out.print("请输入月份：");
            int month = input.nextInt();

            System.out.print("请输入日期：");
            int day = input.nextInt();

            int days = 0;
            int week ;

            switch (month) {
                case 12 :
                    days+=30;
                case 11 :
                    days+=31;
                case 10:
                    days+=30;
                case 9 :
                    days+=31;
                case 8 :
                    days+=31;
                case 7 :
                    days+=30;
                case 6 :
                    days+=31;
                case 5 :
                    days+=30;
                case 4 :
                    days+=31;
                case 3 :
                    days+=28;
                case 2 :
                    days+=31;
                case 1 :
                    days+=day;
                    break;
            }
                    System.out.println(month+"月"+day+"号 是星期"+(days%7+1));
        }
}
